package com.gzq.repository;

import com.gzq.entity.Team;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;


import java.util.List;

public interface TeamDao extends CrudRepository<Team,Long> {
    public List<Team> findByStatus(String status);
    @Query(nativeQuery =true,value = "select * from team where status not in ('leader')ORDER BY ?#{#pageable}")
    public Page<Team> findAll(Pageable pageable);
    @Query(nativeQuery = true,value = "SELECT status from team where status not in ('leader') GROUP BY status")
    public List findDistinctByStatus();
}
